home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20020314-20021006 / 000076_fdc@columbia.edu_Thu May 16 15:07:24 EDT 2002.msg < prev    next >
Text File  |  2020-01-01  |  3KB  |  64 lines

  1. Article: 13370 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!news.columbia.edu!news-not-for-mail
  3. From: fdc@columbia.edu (Frank da Cruz)
  4. Newsgroups: comp.protocols.kermit.misc
  5. Subject: Re: Ask with timeout? Input? help!
  6. Date: 16 May 2002 15:07:14 -0400
  7. Organization: Columbia University
  8. Lines: 47
  9. Message-ID: <ac1012$reu$1@watsol.cc.columbia.edu>
  10. References: <cce7eu8eesu89jdlaoalmb6flbag71h9dg@4ax.com>
  11. NNTP-Posting-Host: watsol.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 1021576036 10078 128.59.39.139 (16 May 2002 19:07:16 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 16 May 2002 19:07:16 GMT
  15. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:13370
  16.  
  17. In article <cce7eu8eesu89jdlaoalmb6flbag71h9dg@4ax.com>,
  18. dgk  <sonicechoesWithNoSpam@hotmail.com> wrote:
  19. : I'm trying to write a script to answer a modem and send and receive
  20. : files. Pretty simple stuff. It will be running on a PC using Kermit95.
  21. : I'm pretty much just using the existing hostmode.ksc and hostmdm.ksc
  22. : and simplifying them a bit to get rid of the menus and just answer the
  23. : phone and connect. Then I want to ask for a username and password,
  24. : select a directory based on that, and send and receive files. I want
  25. : to be the host.
  26. : I am confused over a lot of stuff, but particularly ASK and INPUT. The
  27. : documentation says that ASK reads input from the keyboard and INPUT
  28. : appears to be used for remote sessions, so I guess I need to use
  29. : input.
  30. :
  31. Right.
  32.  
  33. : But that is looking for specific input, not just reading into a
  34. : variable. I guess I can examine the \vbuffer or whatever it is to see
  35. : what actually came in, but I think I'm missing something here.
  36. INPUT can be made to work approximately like ASK as follows:
  37.  
  38.   clear input
  39.   output { Prompt: }
  40.   minput xx {\10} {\13}
  41.   if fail ...
  42.  
  43. Replace "Prompt:" with whatever you want the prompt to be, replace xx
  44. with the number of seconds you want to wait, and then code the IF FAIL
  45. command to do whatever you want if the INPUT times out.
  46.  
  47. If the INPUT succeeds, the \v(input) variable contains what the user
  48. typed.  However, it's still not exactly like ASK because (a) the terminating
  49. carriage return or linefeed is included in the result, and (b) so are any
  50. editing characters, like Delete or Backspace.  You'll note that the hostmode
  51. script includes a function that takes care of this.
  52.  
  53. : Is there a timeout that works with ASK?
  54. :
  55. Yes; for info see "help set ask-timer".
  56.  
  57. : Does ASK work with a serial connection?
  58. No, you'll have to use the method described above.
  59.  
  60. - Frank
  61.